package com.ruoyi.recycle.dto;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@NoArgsConstructor
@Accessors(chain = true)
@ApiModel("家政订单请求体")
public class HousekeepingOrderQueryDTO implements Serializable {

    private static final long serialVersionUID = 3437503901975704824L;
    /**
     * 订单号
     */
    @ApiModelProperty(name = "HKOrderNo", value = "家政订单号")
    private String HKOrderNo;

    /**
     * 联系方式
     */
    @ApiModelProperty(name = "clientId", value = "客户ID")
    private Long clientId;

    /**
     * 联系方式
     */
    @ApiModelProperty(name = "phone", value = "联系方式")
    private String phone;

    /**
     * 下单时间
     */
    @ApiModelProperty(name = "searchTimeBegin", value = "搜索开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date searchTimeBegin;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(name = "searchTimeEnd", value = "搜索结束时间")
    private Date searchTimeEnd;

    /**
     * 取件地址
     */
    @ApiModelProperty(name = "address", value = "联系地址")
    private String address;

    /**
     * 订单状态
     */
    @ApiModelProperty(name = "status", value = "订单状态")
    private String status;

    /**
     * 预估价格
     */
    @ApiModelProperty(name = "forecastMoney", value = "预估价格")
    private BigDecimal forecastMoney;

    /**
     * 实际价格
     */
    @ApiModelProperty(name = "practicalMoney", value = "实际价格")
    private BigDecimal practicalMoney;

    /**
     * 创建人
     */
    @ApiModelProperty(name = "createdBy", value = "创建人")
    private String createdBy;

    /**
     * 更新人
     */
    @ApiModelProperty(name = "updatedBy", value = "更新人")
    private String updatedBy;

    /**
     * 更新时间
     */
    @ApiModelProperty(name = "updatedTime", value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updatedTime;
    @ApiModelProperty(name = "remark", value = "备注")
    private String remark;
    @ApiModelProperty(name = "merchantId", value = "提供服务综合站ID")
    private Long merchantId;

    @ApiModelProperty(name = "currentPage", value = "当前页")
    private Integer currentPage = 1;
    @ApiModelProperty(name = "pageSize", value = "页码大小")
    private Integer pageSize = 10;

    /**
     * 更新人
     */
    private String type;

    public void setSearchTimeEnd(Date searchEnd) {
        this.searchTimeEnd = DateUtil.offsetSecond(searchEnd, 86399).toJdkDate();

    }
}
